package com.itheima.filter1;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
//配置拦截路径
@WebFilter("/hi")
public class HiFilter implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("请求到达资源之前 先到fiter进行拦截");

       //这是放行语句
        chain.doFilter(req, resp);

        System.out.println("你猜我什么时候执行？");
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
